
//Article: Economic conditions and health behaviours during the �Great Recession� Tables 

***********************************************************************
*                                                                     *
*  Commands File                                                      *
*                                                                     *
*  Dataset: MMSA_BRFSSLAU                                             *
*  944,159 BRFSS respondents from 90 MMSAs 2005-2010                  *
*  Linked to MMSA-level unemployment rates, smooth seasonally         *
*  adjusted (SSA)and unadjusted.                                      *
*                                                                     *
*  Dataset: MMSA_BRFSSEP                                              *
*  609,699 BRFSS respondents from 55 MMSAs 2005-2010                  *
*  Linked to MMSA-level employment-population (EP) ratios             *
*																	  *
*  See variable description and notes command for further details     *
*  on variable definition and variable categories                     *
*																	  *
*  Commands below reproduce results from all analytical tables        *
*  Note: the commands below do not rescale the regression coefficients*
*        for categorical variables as shown in published output       *
*  Note: the regressions are ordered and represent numbered           *
*        models from the respective tables in ascending order         *
*      																  *
*                                                                     *
***********************************************************************





use MMSA_BRFSSLAU, clear
set more off

*Table 2: Effect of one percentage-point increase in quarterly MMSA-specific unemployment rate on health behaviours
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' unemprtsa age0 sex i.fips i.quarter [pw=_mmsawt], vce(cluster fips)
regress `var' unemprtsa age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
regress `var' unemprtsa age0 sex c.quarter i.fips i.quarter i.fips#c.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
regress `var' lag1sa age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
}
*
*Table 3: Effect of one percentage-point increase in quarterly MMSA-specific unemployment rate on health behaviours by gender
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' c.unemprtsa##sex age0 i.fips##sex i.quarter##sex [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(unemprtsa) vce(unconditional)
regress `var' c.unemprtsa##sex age0 i.fips##sex i.quarter##sex i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(unemprtsa) vce(unconditional)
regress `var' c.unemprtsa##sex age0 i.quarter##sex i.fips##c.quarter##sex i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(unemprtsa) vce(unconditional)
regress `var' c.lag1sa##sex age0 i.fips##sex i.quarter##sex i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(lag1sa) vce(unconditional)
}
*
*Table 4: Effect of one percentage-point increase in quarterly MMSA-specific unemployment rate by employment status for health behaviours
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' c.unemprtsa##i.empstat1 age0 sex i.fips##i.empstat1 i.quarter##i.empstat1 i.race4 i.educa i.income2 i.marital [pw=_mmsawt], vce(cluster fips)
margins(empstat1), dydx(unemprtsa) vce(unconditional)
}
*

//Online Supplementary: Unemployment Rate

/*eTable 2: Comparing the effect of one-percentage point increase in quarterly MMSA-specific unemployment rate on
 binary health behaviors using ordinary least squares (OLS) and logistic regression models */
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' unemprtsa age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
}
*
foreach var of varlist comphv smokerdum1 smokerdum2 stopsmk2 _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
quietly logit `var' unemprtsa age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins, dydx(unemprtsa) vce(unconditional)
}
*
*eTable 3: Effect of one-percentage point increase in quarterly seasonally-unadjusted MMSA-specific unemployment rate on health behaviors  
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' unemprt age0 sex i.fips i.quarter [pw=_mmsawt], vce(cluster fips)
regress `var' unemprt age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
}
*
/*eTable 4:Effect of one-percentage point increase in quarterly seasonally-adjusted MMSA-specific unemployment rate on
 health behaviors, with quadratic for unemployment rate */
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' c.unemprtsa##c.unemprtsa age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
}
*

//Online Supplementary: Employment-Population (EP) Ratio

use MMSA_BRFSSEP, clear

*eTable 5: Effect of one-percentage point increase in quarterly MMSA-specific employment population (EP) ratio on health behaviors
foreach var of varlist compmo comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' ep age0 sex i.fips i.quarter [pw=_mmsawt], vce(cluster fips)
regress `var' ep age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
regress `var' ep age0 sex c.quarter i.fips i.quarter i.fips#c.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
regress `var' lag1ep age0 sex i.fips i.quarter i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
}
*
*eTable 6: Effect of one-percentage point increase in quarterly MMSA-specific employment population (EP) ratio on health behaviors by gender 
foreach var of varlist compmo comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' c.ep##sex age0 i.fips##sex i.quarter##sex [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(ep) vce(unconditional)
regress `var' c.ep##sex age0 i.fips##sex i.quarter##sex i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(ep) vce(unconditional)
regress `var' c.ep##sex age0 i.quarter##sex i.fips##c.quarter##sex i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(ep) vce(unconditional)
regress `var' c.lag1ep##sex age0 i.fips##sex i.quarter##sex i.race4 i.educa i.income2 i.marital i.empstat1 [pw=_mmsawt], vce(cluster fips)
margins(sex), dydx(lag1ep) vce(unconditional)
}
*
/*eTable 7: Effect of one-percentage point increase in quarterly MMSA-specific employment population (EP) ratio
 by employment status for health behaviors */
foreach var of varlist compmo  comphv avedrnk2 smokerdum1 smokerdum2 stopsmk2 _bmi _rfbmi4 _rfbmiob _rfbmiobsev exerany2 {
regress `var' c.ep##i.empstat1 age0 sex i.fips##i.empstat1 i.quarter##i.empstat1 i.race4 i.educa i.income2 i.marital [pw=_mmsawt], vce(cluster fips)
margins(empstat1), dydx(ep) vce(unconditional)
}
*

























